class ReverseString{
	public static void reverse(StringBuffer str){
		if (str == null) return;
		System.out.println("Before->"+str);
		int len = str.length();
		for (int i=0; i<len/2; i++){
			char c = str.charAt(i);
			str.setCharAt(i,str.charAt(len-1-i));
			str.setCharAt(len-1-i,c);
		}
		System.out.println("After->"+str);
	}
	
	public static void main(String[] args){
		StringBuffer s = new StringBuffer("abcxdaede");
		reverse(s);
	}
}